<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量</title>
</head>
<body>
<script>
    /**
     * let：
     * 作用域：块级
     */

    function example(){
        let a =10;
        if(true){
            let b = 20;
            console.log(a);
        }
        console.log(a)
        // console.log(b)  //报错，RefencenceError: b is not defined
    }

    example();



</script>
</body>
</html>
